//build:20240524
//To simplify the use of the micro-light communication protocol for NFC components, NFC is encapsulated in this worker. Users only need to subscribe to events in the event center to listen to NFC.
import log from './dxLogger.js'
import nfc from './dxNfc.js'
import dxMap from './dxMap.js'
import std from './dxStd.js'
const map = dxMap.get('default')
const options = map.get("__nfc__run_init")

function run() {
    nfc.worker.beforeLoop(options)
    log.info('nfc start......')
    std.setInterval(() => {
        try {
            nfc.worker.loop(options)
        } catch (error) {
            log.error(error)
        }
    }, 10)
}

try {
    run()
} catch (error) {
    log.error(error)
}